<template>
	<view>
		<tn-nav-bar >我的团队</tn-nav-bar>
		<view class="my_order" :style="{paddingTop: vuex_custom_bar_height+30+ 'px'}">
			
			
			<tn-list-view unlined="bottom"  backgroundColor="none">
			  <tn-list-cell :unlined="true" v-for="(item,index) in list" :key="index" backgroundColor="none">
			    <view class="message">
			      <view class="message__left">
			        <tn-avatar :src="item.avatar" imgMode="aspectFit"></tn-avatar>
			      </view>
			      <view class="message__middle">
			        <view class="message__name">{{item.nickname}}</view>
			        <view class="message__content tn-text-ellipsis">{{item.created_at|parseTime}}</view>
			      </view>
			      <view class="message__right">
			       <!-- <view class="message__time">{{item.created_at|parseTime}}</view>
			        <view class="message__tips">
			          <tn-tag backgroundColor="tn-bg-red" fontColor="tn-color-white" shape="circle" width="auto" size="sm">99</tn-tag>
			        </view> -->
			      </view>
			    </view>
			  </tn-list-cell>
			</tn-list-view>
			
			<view class="empty__item" v-if="list.length < 1 && !loading" style="margin-top: 200px;">
			  <tn-empty mode="list"></tn-empty>
			</view>
			
		</view>	
		<TemplateLoading :active="loading"></TemplateLoading>
	</view>
</template>

<script>
	import {groupList} from '@/api/user/index.js'
	export default {
		data() {
			return {
				loading:false,
				list:[]
			}
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData(){
				this.loading = true
				groupList().then(res=>{
					this.list = res
					this.loading = false
				},err=>{
					this.loading = false
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
  .my_order{
  	  background: $tn-main-bg;
  	  height: 100vh;
  	  padding-left: 6%;
  	  padding-right: 6%;
  }
  
  .tn-radius10{border-radius: 10rpx;}
 
  .custom-title {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 10rpx 20rpx;
  }
  
  .list__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .list {
    &__left {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      
      &__icon, &__image {
        margin-right: 18rpx;
      }
    }
    
    &__right {
      display: flex;
      align-items: center;
      justify-content: flex-end;
    }
  }
  
  .list-icon-text, .list-image-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  
  .list-image-text {
    .list {
      &__left {
        &__image {
          width: 20rpx;
          height: 20rpx;
        }
      }
    }
  }
  
  .message {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    
    &__left {
      width: 10%;
    }
    &__middle {
      width: 80%;
      padding-left: 20rpx;
      padding-right: 40rpx;
    }
    &__right {
      width: 10%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    
    &__name {
      font-size: 32rpx;
      margin-bottom: 8rpx;
    }
    &__content {
      font-size: 26rpx;
      color: #838383;
    }
    &__tips {
      &__icon {
        font-size: 36rpx;
        color: #AAAAAA;
      }
    }
  }
</style>

